import excel "C:\Users\shane\OneDrive\My Documents\Psychology\Miami\Miami Projects and data\Spreads misinfo\spring_2022_survey_shares_misinfo.xlsx", sheet("spring_2022_survey_shares_misin") firstrow

ssc install schemepack

*Create labels for variables of interest

						*Demographics
clonevar female = Q2
recode female 1=0 2=1
label define female 0 "Male" 1 "Female"
label values female female
label variable female "Female"

clonevar hispanic = Q4
label variable hispanic "Hispanic"
recode hispanic 1=1 2=0
label define hispanic 1 "Yes" 0 "No"
label values hispanic hispanic

clonevar white = Q3_1
mvencode white, mv(0)
label variable white "white"

clonevar black = Q3_2
mvencode black, mv(0)
label variable black "Black or African American"

clonevar asian = Q3_3
mvencode asian, mv(0)
label variable asian "Asian-American or Pacific Islander"

clonevar nat_am = Q3_4
mvencode nat_am, mv(0)
label variable nat_am "Native American / American Indian"

clonevar race_other = Q3_5
mvencode race_other, mv(0)
label variable race_other "Race, Other"

clonevar income = Q5
label variable income "Income"
label define income 1 "Less than $25,000" 2 "$25,000 to $49,999" 3 "$50,000 to $74,999" 4 "$75,000 to $99,999" 5 "$100,000 to $149,999" 6 "$150,000 to $199,999" 7 "$200,000 or more"
label values income income

clonevar education = Q6
label variable education "Education"
label define education 1 "Less than high school" 2 "High school graduate or GED" 3 "Some college but no degree (yet)" 4 "2-year college degree" 5 "4-year college degree" 6 "Post-graduate degree (MA, MBA, MD, JD, PhD, etc.)"
label values education education

*Age, from year born (q7)
generate age = 2022 - Q7
summarize age
label variable age "Age"
		*make groupings for demog table
gen age_grp=.
replace age_grp=1 if age<=24
replace age_grp=2 if (age>24 & age<=44)
replace age_grp=3 if (age>44 & age<=64)
replace age_grp=4 if (age>=65)
tab age_grp

clonevar state = Q8
label variable state "State"


					*Political affiliations and ideology
clonevar party_id = Q9
label define party_id 1 "Democrat" 2 "Republican" 3 "Independent" 4 "Something else"
label values party_id party_id
label variable party_id "Party ID"

*Create dummy variables for Party ID
recode party_id 1=1 2/4=0, gen(democrat)
label variable democrat "Democrat"
recode party_id 1=0 2=1 3=0 4=0, gen(republican)
label variable republican "Republican"
recode party_id 1=0 2=0 3=1 4=0, gen(independent)
label variable independent "Independent"
recode party_id 1=0 2=0 3=0 4=1, gen(other_party)
label variable other_party "Other party"

*Create a new recoded variable for Q9 Party_ID (continuous, low to high, with Indeps and Others combined)
recode party_id 1=1 2=3 3=2 4=2, generate(party_id_continuous)
label variable party_id_continuous "Party ID (continuous)"
label define party_id_continuous 1 "Democrat" 2 "Independents/Others" 3 "Republican" 
label values party_id_continuous party_id_continuous


clonevar strong_rep = Q10
recode strong_rep 1=1 2=0
label variable strong_rep "Strong Republican"
label define strong_rep 1 "Strong" 0 "Not very strong"

clonevar strong_dem = Q11
recode strong_dem 1=1 2=0
label variable strong_dem "Strong Democrat"
label define strong_dem 1 "Strong" 0 "Not very strong"

clonevar closer_to = Q12
label variable closer_to "Closer to Republican or Democrat"
label define closer_to 1 "Republican" 2 "Democrat" 3 "Neither"
recode closer_to 1=3 2=1 3=2, generate(closer_to_continuous)
label variable closer_to_continuous "Closer to Rep or Dem (continuous)"
label define closer_to_continuous 1 "Democrat" 2 "Neither" 3 "Republican" 
label values closer_to_continuous closerto_RepDem


clonevar libcon = Q13
label variable libcon "Ideology (Lib-Con)"
label define libcon 1 "Very Liberal" 2 "Liberal" 3 "Slightly Liberal" 4 "Moderate" 5 "Slightly Conservative" 6 "Conservative" 7 "Very Conservative"
label values libcon libcon

*gen 7-point party id (q9-12) to run DEM-REP
gen demrep7=.
replace demrep7=1 if Q11==1
replace demrep7=2 if Q11==2
replace demrep7=3 if Q12==2
replace demrep7=4 if Q12==3
replace demrep7=5 if Q12==1
replace demrep7=6 if Q10==2
replace demrep7=7 if Q10==1
tab demrep7
tab demrep7 Q11
tab demrep7 Q10
tab demrep7 Q12
label variable demrep7 "Party ID (Dem-Rep)"

*fold pid for intensity
gen pid7_str=.
replace pid7_str=4 if demrep7==1
replace pid7_str=3 if demrep7==2
replace pid7_str=2 if demrep7==3
replace pid7_str=1 if demrep7==4
replace pid7_str=2 if demrep7==5
replace pid7_str=3 if demrep7==6
replace pid7_str=4 if demrep7==7
label variable pid7_str "Partisan Strength" 
tab demrep7 pid7_str


*fold ideo for intensity
gen ideo_str=.
replace ideo_str=4 if libcon==1
replace ideo_str=3 if libcon==2
replace ideo_str=2 if libcon==3
replace ideo_str=1 if libcon==4
replace ideo_str=2 if libcon==5
replace ideo_str=3 if libcon==6
replace ideo_str=4 if libcon==7
label variable ideo_str "Ideological Strength"
tab libcon ideo_str

					*Religiosity items
					
*Each items uses a different scale, so must standardize them before combining into same variable
tab Q14
recode Q14 1=4 2=3 3=2 4=1, generate(relig_impt)
label variable relig_impt "Religion importance"


	*Zero "Don't knows", so code DK as 1
tab Q15
recode Q15 1=6 2=5 3=4 4=3 5=2 6=1 7=1, generate(relig_srvs)
label variable relig_srvs "Religious service attendance"


	*Only 36 DKs, so code DK as 1
tab Q16
recode Q16  1=7 2=6 3=5 4=4 5=3 6=2 7=1 8=1, generate(relig_prayer)
label variable relig_prayer "Frequency of prayer"

foreach var of varlist relig_impt relig_srvs relig_prayer{
		qui sum `var'
		replace `var' = (`var' - `r(min)') / (`r(max)'-`r(min)')
	}		
	
factor relig_impt relig_srvs relig_prayer, pcf blanks(.3)

alpha relig_impt relig_srvs relig_prayer, generate(religiosity)
label variable religiosity "Religiosity"


					
					*Political attitudes and engagement
					
*Feeling thermometers
clonevar demParty = Q37_1
label variable demParty "Democrat Party"
clonevar repParty = Q37_3
label variable repParty "Republican Party"
clonevar trump = Q37_4
label variable trump "Donald Trump"
clonevar biden = Q37_15
label variable biden "Joe Biden"
clonevar sanders = Q37_16
label variable sanders "Bernie Sanders"
clonevar putin = Q37_22
label variable putin "Vladimir Putin"

clonevar qAnon = Q287_17
label variable qAnon "QAnon"
clonevar prdBoys = Q287_18
label variable prdBoys "Proud Boys"
clonevar whtNats = Q287_19
label variable whtNats "White Nationalists"
clonevar antifa = Q287_20
label variable antifa "Antifa"
clonevar progrsvs = Q287_21
label variable progrsvs "Progressives"
clonevar china = Q287_23
label variable china "China"

summarize demParty repParty trump biden sanders putin qAnon prdBoys whtNats antifa progrsvs china



*Political participation measures
recode Q38_1 5=1 4=2 3=3 2=4 1=5, generate(office_run) 
label variable office_run "Might run for office"
recode Q38_2 5=1 4=2 3=3 2=4 1=5, generate(office_qual)
label variable office_qual "Qualified for office"

clonevar polpart_protest = Q39_1
label variable polpart_protest "Political protests"


clonevar polpart_meeting = Q39_2
label variable polpart_meeting "Political meetings"


clonevar polpart_contacted = Q39_3
label variable polpart_contacted "Contacted elected official"


clonevar polpart_volunteer = Q39_4
label variable polpart_volunteer "Election volunteer"


clonevar polpart_civdis = Q39_5
label variable polpart_civdis "Civil disobedience"


clonevar polpart_violence = Q39_6
label variable polpart_violence "Political violence"


*Political interest and efficacy
recode Q40_1 5=1 4=2 3=3 2=4 1=5, generate(pol_influence)
label variable pol_influence "Influence government"
recode Q40_2 5=1 4=2 3=3 2=4 1=5, generate(pol_follow)
label variable pol_follow "Follow politics"


					**Psychological variables

*Conspiratorial Thinking Scale
recode CTSCALE_1 1=5 2=4 3=3 4=2 5=1, gen(CTS_1)
recode CTSCALE_2 1=5 2=4 3=3 4=2 5=1, gen(CTS_2)
recode CTSCALE_3 1=5 2=4 3=3 4=2 5=1, gen(CTS_3)
recode CTSCALE_4 1=5 2=4 3=3 4=2 5=1, gen(CTS_4)

factor CTS_1 CTS_2 CTS_3 CTS_4, ipf blanks(.3)

	*Now create an overall Conspiracy thinking variable (alpha = .8657)
alpha CTS_1 CTS_2 CTS_3 CTS_4, generate(consp_think)
label variable consp_think "Conspiratorial thinking style"


*Left-wing Authoritarianism (anti-hierarchical attitudes subscale)
recode Q42_1 1=5 2=4 3=3 4=2 5=1, generate(LWA_1)
recode Q42_2 1=5 2=4 3=3 4=2 5=1, generate(LWA_2)
recode Q42_3 1=5 2=4 3=3 4=2 5=1, generate(LWA_3)

factor LWA_1 LWA_2 LWA_3, ipf blanks(.3)

	*Reliability of LWA (alpha = .8954)
alpha LWA_1 LWA_2 LWA_3, generate(left_wing_auth)
label variable left_wing_auth "Left-wing Authoritarianism"


*Right-wing Authoritarianism (Item 2 already reverse-coded)
recode Q43_1 1=5 2=4 3=3 4=2 5=1, generate(RWA_1)
clonevar RWA_2 = Q43_2
recode Q43_3 1=5 2=4 3=3 4=2 5=1, generate(RWA_3)
recode Q43_4 1=5 2=4 3=3 4=2 5=1, generate(RWA_4)

factor RWA_1 RWA_2 RWA_3 RWA_4, ipf blanks(.3)

	*RWA_2 loads poorly with other items and crossloads on F1 and F2. 	Consider dropping?

*Reliability of RWA (poor reliability, alpha = .6642; dropping RWA_2 increases alpha to .6848)
alpha RWA_1 RWA_2 RWA_3 RWA_4, generate(right_wing_auth)
label variable right_wing_auth "Right-wing Authoritarianism"



*Need for Chaos Scale (alpha = .9176)
recode Q46_1 1=5 2=4 3=3 4=2 5=1, generate(NFC_1)
recode Q46_2 1=5 2=4 3=3 4=2 5=1, generate(NFC_2)
recode Q46_3 1=5 2=4 3=3 4=2 5=1, generate(NFC_3)
recode Q46_4 1=5 2=4 3=3 4=2 5=1, generate(NFC_4)
recode Q46_5 1=5 2=4 3=3 4=2 5=1, generate(NFC_5)
recode Q46_6 1=5 2=4 3=3 4=2 5=1, generate(NFC_6)

factor NFC_1 NFC_2 NFC_3 NFC_4 NFC_5 NFC_6, ipf blanks(.3)

alpha NFC_1 NFC_2 NFC_3 NFC_4 NFC_5 NFC_6, gen(need_chaos)
label variable need_chaos "Need for Chaos"


*Predisposition to argue (alpha = .7230)
recode Q49_1 1=5 2=4 3=3 4=2 5=1, generate(Argue_1)
recode Q49_2 1=5 2=4 3=3 4=2 5=1, generate(Argue_2)
recode Q49_3 1=5 2=4 3=3 4=2 5=1, generate(Argue_3)

factor Argue_1 Argue_1 Argue_3, ipf blanks(.3)

alpha Argue_1 Argue_2 Argue_3, generate(argue)
label variable argue "Argumentativeness"


*General Conflict Tactic Scale (GCTS, alpha = .7214)
recode CONFLICT_1 1=0 2=1, generate(GCTS_1)
recode CONFLICT_2 1=0 2=1, generate(GCTS_2)
recode CONFLICT_3 2=0 1=1, generate(GCTS_3)
recode CONFLICT_4 2=0 1=1, generate(GCTS_4)
recode CONFLICT_5 2=0 1=1, generate(GCTS_5)
recode CONFLICT_6 2=0 1=1, generate(GCTS_6)
recode CONFLICT_7 2=0 1=1, generate(GCTS_7)
recode CONFLICT_8 2=0 1=1, generate(GCTS_8)

generate conflict = GCTS_3 + GCTS_4 + GCTS_5 + GCTS_6 + GCTS_7 + GCTS_8
label variable conflict "Conflict"

factor GCTS_1 GCTS_2 GCTS_3 GCTS_4 GCTS_5 GCTS_6 GCTS_7 GCTS_8, pcf blanks(.3)

	*GCTS_1 and GCTS_2 load on a separate, weak factor. GCTS_3 cross loads. Consider dropping all three? Increases reliability to alpha = .8544

alpha GCTS_1 GCTS_2 GCTS_3 GCTS_4 GCTS_5 GCTS_6 GCTS_7 GCTS_8
alpha GCTS_3 GCTS_4 GCTS_5 GCTS_6 GCTS_7 GCTS_8


*Dark Tetrad 

	*Machiavellianism (alpha = .8812)
recode MACH_1 1=5 2=4 3=3 4=2 5=1, generate(Mach1)
recode MACH_2 1=5 2=4 3=3 4=2 5=1, generate(Mach2)
recode MACH_3 1=5 2=4 3=3 4=2 5=1, generate(Mach3)
recode MACH_4 1=5 2=4 3=3 4=2 5=1, generate(Mach4)

factor Mach1 Mach2 Mach3 Mach4, ipf blanks(.3)

alpha Mach1 Mach2 Mach3 Mach4, generate(mach)
label variable mach "Machiavellianism"


	*Narcissism (alpha = .8893)
recode NARC_1 1=5 2=4 3=3 4=2 5=1, generate(Narc1)
recode NARC_2 1=5 2=4 3=3 4=2 5=1, generate(Narc2)
recode NARC_3 1=5 2=4 3=3 4=2 5=1, generate(Narc3)
recode NARC_4 1=5 2=4 3=3 4=2 5=1, generate(Narc4)

factor Narc1 Narc2 Narc3 Narc4, ipf blanks(.3)

alpha Narc1 Narc2 Narc3 Narc4, generate(narc)
label variable narc "Narcissism"


	*Psychoticism (alpha = .8670)
recode PSYC_1 1=5 2=4 3=3 4=2 5=1, generate(Psych1)
recode PSYC_2 1=5 2=4 3=3 4=2 5=1, generate(Psych2)
recode PSYC_3 1=5 2=4 3=3 4=2 5=1, generate(Psych3)
recode PSYC_4 1=5 2=4 3=3 4=2 5=1, generate(Psych4)

factor Psych1 Psych2 Psych3 Psych4, ipf blanks(.3)

alpha Psych1 Psych2 Psych3 Psych4, generate(psycho)
label variable psycho "Psychoticism"


	*Sadism (alpha = .7619)
recode SADISM_1 1=5 2=4 3=3 4=2 5=1, generate(Sadism1)
recode SADISM_2 1=5 2=4 3=3 4=2 5=1, generate(Sadism2)
recode SADISM_3 1=5 2=4 3=3 4=2 5=1, generate(Sadism3)
recode SADISM_4 1=5 2=4 3=3 4=2 5=1, generate(Sadism4)

factor Sadism1 Sadism2 Sadism3 Sadism4, ipf blanks(.3)

alpha Sadism1 Sadism2 Sadism3 Sadism4, generate(sadism)
label variable sadism "Sadism"


	*Dark Tetrad
factor Mach1 Mach2 Mach3 Mach4 Narc1 Narc2 Narc3 Narc4 Psych1 Psych2 Psych3 Psych4 Sadism1 Sadism2 Sadism3 Sadism4, ipf blanks(.3)


alpha Mach1 Mach2 Mach3 Mach4 Narc1 Narc2 Narc3 Narc4 Psych1 Psych2 Psych3 Psych4 Sadism1 Sadism2 Sadism3 Sadism4, generate(dark_tetrad)
label variable dark_tetrad "Dark Tetrad"


*Victimhood Scale (alpha = .8967)
recode VICTIM_1 1=5 2=4 3=3 4=2 5=1, generate(Victim1)
recode VICTIM_2 1=5 2=4 3=3 4=2 5=1, generate(Victim2)
recode VICTIM_3 1=5 2=4 3=3 4=2 5=1, generate(Victim3)
recode VICTIM_4 1=5 2=4 3=3 4=2 5=1, generate(Victim4)

factor Victim1 Victim2 Victim3 Victim4, ipf blanks(.3)

alpha Victim1 Victim2 Victim3 Victim4, generate(victimhood)
label variable victimhood "Victimhood"


*Dogmatism
recode Q61_1 1=5 2=4 3=3 4=2 5=1, generate(Dog_1)
recode Q61_2 1=5 2=4 3=3 4=2 5=1, generate(Dog_2)
recode Q61_3 1=5 2=4 3=3 4=2 5=1, generate(Dog_3)

factor Dog_1 Dog_2 Dog_3, ipf blanks(.3)

alpha Dog_1 Dog_2 Dog_3, generate(dogmatism)
label variable dogmatism "Dogmatism"


*Impulsiveness
recode Q62_1 1=5 2=4 3=3 4=2 5=1, generate(Imp_1)
	*Items 2 thru 4 are already reverse-coded
clonevar Imp_2 = Q62_2
clonevar Imp_3 = Q62_3
clonevar Imp_4 = Q62_4

factor Imp_1 Imp_2 Imp_3 Imp_4, ipf blanks(.3)

alpha Imp_1 Imp_2 Imp_3 Imp_4, generate(impulsive)
label variable impulsive "Impulsiveness"


*Paranoia
recode Q74_1 1=5 2=4 3=3 4=2 5=1, generate(Para_1)
recode Q74_2 1=5 2=4 3=3 4=2 5=1, generate(Para_2)
recode Q74_3 1=5 2=4 3=3 4=2 5=1, generate(Para_3)

factor Para_1 Para_2 Para_3, ipf blanks(.3)

alpha Para_1 Para_2 Para_3, generate(paranoia)
label variable paranoia "Paranoia"


*Positive and Negative Affect Schedule - Short Form (PANAS-SF)
clonevar PNAS_1 = Q75_1
clonevar PNAS_2 = Q75_2
clonevar PNAS_3 = Q75_3
clonevar PNAS_4 = Q75_4
clonevar PNAS_5 = Q75_5
clonevar PNAS_6 = Q288_1
clonevar PNAS_7 = Q288_2
clonevar PNAS_8 = Q288_3
clonevar PNAS_9 = Q288_4
clonevar PNAS_10 = Q288_5
clonevar PNAS_11 = Q289_1
clonevar PNAS_12 = Q289_2
clonevar PNAS_13 = Q289_3
clonevar PNAS_14 = Q289_4
clonevar PNAS_15 = Q289_5
clonevar PNAS_16 = Q290_1
clonevar PNAS_17 = Q290_2
clonevar PNAS_18 = Q290_3
clonevar PNAS_19 = Q290_4
clonevar PNAS_20 = Q290_5


generate pos_affect = (PNAS_1 + PNAS_3 + PNAS_5 + PNAS_9 + PNAS_10 + PNAS_12 + PNAS_14 + PNAS_16 + PNAS_17 + PNAS_19)

alpha PNAS_1 PNAS_3 PNAS_5 PNAS_9 PNAS_10 PNAS_12 PNAS_14 PNAS_16 PNAS_17 PNAS_19
label variable pos_affect "Positive Affect"
*POS_AFFECT alpha = .8395

generate neg_affect = (PNAS_2 + PNAS_4 + PNAS_6 + PNAS_7 + PNAS_8 + PNAS_11 + PNAS_13 + PNAS_15 + PNAS_18 + PNAS_20)

alpha PNAS_2 PNAS_4 PNAS_6 PNAS_7 PNAS_8 PNAS_11 PNAS_13 PNAS_15 PNAS_18 PNAS_20
label variable neg_affect "Negative Affect"
*NEG_AFFECT alpha = .8820


*Subjective numeracy
rename Q77 subnum1
rename Q78 subnum2
rename Q79 subnum3

factor subnum1 subnum2 subnum3, ipf blanks(.3)

alpha subnum1 subnum2 subnum3, generate(subj_num)
label variable subj_num "Subjective Numeracy"


*Intolerance of Uncertainty
recode Q81_1 1=5 2=4 3=3 4=2 5=1, generate(uncertain1)
recode Q81_2 1=5 2=4 3=3 4=2 5=1, generate(uncertain2)
recode Q81_3 1=5 2=4 3=3 4=2 5=1, generate(uncertain3)

factor uncertain1 uncertain2 uncertain3, ipf blanks(.3)

alpha uncertain1 uncertain2 uncertain3, generate(intol_uncertainty)
label variable intol_uncertainty "Intolerance of Uncertainty"


*Confidence in the Scientific Community
recode Q84 1=5 2=4 3=3 4=2 5=1, generate(scicom_confidence)
label variable scicom_confidence "Confidence in Scientific Community"


*Science literacy
recode SCILIT_1 1=1 2=0, generate(scilit_1)
recode SCILIT_2 1=1 2=0, generate(scilit_2)
recode SCILIT_3 1=1 2=0, generate(scilit_3)
recode SCILIT_4 1=1 2=0, generate(scilit_4)
recode SCILIT_5 1=1 2=0, generate(scilit_5)
recode SCILIT_6 1=1 2=0, generate(scilit_6)

factor scilit_1 scilit_2 scilit_3 scilit_4 scilit_5 scilit_6, pcf blanks(.3)

generate science_literacy = scilit_1 + scilit_2 + scilit_3 + scilit_4 + scilit_5 + scilit_6
label variable science_literacy "Scientific Literacy"



*Perceived sense of power/control on social media
recode Q89_1 1=5 2=4 3=3 4=2 5=1, generate(socmed_pwr1)
recode Q89_2 1=5 2=4 3=3 4=2 5=1, generate(socmed_pwr2)
recode Q89_3 1=5 2=4 3=3 4=2 5=1, generate(socmed_pwr3)
	
factor socmed_pwr1 socmed_pwr2 socmed_pwr3, ipf blanks (.3)
	
alpha socmed_pwr1 socmed_pwr2 socmed_pwr3, generate(socmedia_power)
label variable socmedia_power "Social Media - Perceived sense of power"
	
	
*Social Media Expression
recode Q97_1 1=5 2=4 3=3 4=2 5=1, generate(SME_1)
recode Q97_2 1=5 2=4 3=3 4=2 5=1, generate(SME_2)
recode Q97_3 1=5 2=4 3=3 4=2 5=1, generate(SME_3)

factor SME_1 SME_2 SME_3, ipf blanks(.3)

alpha SME_1 SME_2 SME_3, generate(socmedia_expression)
label variable socmedia_expression "Social Media Expression"


*Spread Misinformation
recode Q94 1=5 2=4 3=3 4=2 5=1, generate(spreads_misinfo)
label variable spreads_misinfo "Shares false information"
label define spreads_misinfo 1 "SD" 2 "D" 3 "N" 4 "A" 5 "SA"
label values spreads_misinfo spreads_misinfo

recode Q94 1=1 2=1 3=0 4=0 5=0, generate(spreads_YN)
label variable spreads_YN "Spreads misinformation Y/N"
label define spreads_YN 0 "No" 1 "Yes"
label values spreads_YN spreads_YN


*Offline Media Use
recode Q95_1 1=5 2=4 3=3 4=2 5=1, generate(OFFLINE_network)
recode Q95_2 1=5 2=4 3=3 4=2 5=1, generate(OFFLINE_cable)
recode Q95_3 1=5 2=4 3=3 4=2 5=1, generate(OFFLINE_local)
recode Q95_4 1=5 2=4 3=3 4=2 5=1, generate(OFFLINE_print)
recode Q95_5 1=5 2=4 3=3 4=2 5=1, generate(OFFLINE_radio)

label variable OFFLINE_network "Network TV News"
label variable OFFLINE_cable "Cable TV News"
label variable OFFLINE_local "Local TV News"
label variable OFFLINE_print "Print newspapers"
label variable OFFLINE_radio "Radio"


factor OFFLINE_network OFFLINE_cable OFFLINE_local OFFLINE_print OFFLINE_radio, pcf blanks(.3)

rotate, oblimin(0) oblique kaiser blanks(.300)

*PCA supports a 1-factor solution, so create a mean score for Legacy Media Use
alpha OFFLINE_network OFFLINE_cable OFFLINE_local OFFLINE_print OFFLINE_radio, generate(legacy_media)
label variable legacy_media "Legacy Mainstream News Media"


*Online Media Use
recode Q96_1 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_newspapers)
recode Q96_2 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_newsmags)
recode Q96_3 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_blogs)
recode Q96_4 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_YouTube)
recode Q96_5 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_Facebook)
recode Q96_6 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_Twitter)
recode Q96_7 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_Reddit)
recode Q96_8 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_Instagram)
recode Q96_9 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_TVnewssites)
recode Q96_10 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_8kun)
recode Q96_11 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_Telegram)
recode Q96_12 1=5 2=4 3=3 4=2 5=1, generate(ONLINE_TruthSocial)

label variable ONLINE_newspapers "Online newspapers"
label variable ONLINE_newsmags "Online news magazines"
label variable ONLINE_blogs "Blogs"
label variable ONLINE_YouTube "YouTube"
label variable ONLINE_Facebook "Facebook"
label variable ONLINE_Twitter "Twitter"
label variable ONLINE_Reddit "Reddit"
label variable ONLINE_Instagram "Instagram"
label variable ONLINE_TVnewssites "TV News websites"
label variable ONLINE_8kun "8Kun"
label variable ONLINE_Telegram "Telegram"
label variable ONLINE_TruthSocial "Truth Social"


factor ONLINE_newspapers ONLINE_newsmags ONLINE_blogs ONLINE_YouTube ONLINE_Facebook ONLINE_Twitter ONLINE_Reddit ONLINE_Instagram ONLINE_TVnewssites ONLINE_8kun ONLINE_Telegram ONLINE_TruthSocial, pcf blanks(.3)

rotate, oblimin(0) oblique kaiser blanks(.300)

	*PCA supports a 3-factor solution (PCA1 = alt websites; PCA2 = popular social media sites; PCA3 = mainstream media sites). Can be treated as 1 variable or as 3.

	*As 1 variable
alpha ONLINE_newspapers ONLINE_newsmags ONLINE_blogs ONLINE_YouTube ONLINE_Facebook ONLINE_Twitter ONLINE_Reddit ONLINE_Instagram ONLINE_TVnewssites ONLINE_8kun ONLINE_Telegram ONLINE_TruthSocial, generate(online_media_ALL)

	*As 3 variables
alpha ONLINE_blogs ONLINE_Reddit ONLINE_8kun ONLINE_Telegram ONLINE_TruthSocial, generate(online_ALTmedia)
label variable online_ALTmedia "Alternative Social Media"

alpha ONLINE_YouTube ONLINE_Facebook ONLINE_Twitter ONLINE_Instagram, generate(online_SOCIALmedia)
label variable online_SOCIALmedia "Mainstream Social Media"

alpha ONLINE_newspapers ONLINE_newsmags ONLINE_TVnewssites, generate(online_MSmedia)
label variable online_MSmedia "Online Mainstream News Media"



						**Statistical analyses**

*Generating frequency tables for main demographics variables
tab female
tab age_grp
summarize age
tab income
tab education
tab party_id
tab spreads_misinfo


							**Finding #1**
							
tab spreads_misinfo spreads_YN

fre spreads_YN

pwcorr spreads_misinfo Sadism3 Mach1 Mach2, sig star(.05)

*Histogram plotting distribution of responses to "spreads_misinfo" item

set scheme tab2

histogram spreads_misinfo, percent fcolor(navy) lcolor(black) barwidth(.5) gap(5) addlabopts(yvarformat(%4.0f)) ytitle("Percent", size(medsmall)) xtitle("Agreement", size(medsmall)) xlabel(, labels valuelabel nogrid) title("I share information on social media about politics", size(large)) subtitle("even though I believe it may be false", size(large))


*Alternate bar graph for just Y/N*

graph bar (percent), over(spreads_YN) blabel(total, format(%4.1f)) bar(1, fcolor(navy) lcolor(black) lwidth(.25)) ytitle("Percent", size(medsmall)) b1title("Agreement", size(medium)) title("I share information on social media about politics", size(medlarge)) subtitle("even though I believe it may be false", size(medlarge)) yscale(r(0 100)) ylabel(0 20 40 60 80 100) 


							**Finding #2**
*Correlations between "spreads misinformation" (DV) and political behaviors

pwcorr spreads_misinfo office_qual office_run polpart_protest polpart_meeting polpart_contacted polpart_volunteer polpart_civdis polpart_violence pol_influence pol_follow, sig star(.05)


*Horizontal bar graph

ci2 spreads_misinfo office_qual, corr
ci2 spreads_misinfo office_run, corr
ci2 spreads_misinfo polpart_protest, corr
ci2 spreads_misinfo polpart_meeting, corr
ci2 spreads_misinfo polpart_contacted, corr
ci2 spreads_misinfo polpart_volunteer, corr
ci2 spreads_misinfo polpart_civdis, corr
ci2 spreads_misinfo polpart_violence, corr
ci2 spreads_misinfo pol_influence, corr
ci2 spreads_misinfo pol_follow, corr

preserve

matrix drop _all
		*make a 1-row matrix w/ correlations
matrix A = (0.396,0.520,0.405,0.362,0.239,0.406,0.440,0.458,0.228,0.051)
		*make a 1-row matrix w/ lower CIs
matrix B = (0.358,0.487,0.368,0.324,0.197,0.369,0.404,0.423,0.186,0.007)
		*make a 1-row matrix w/ upper CIs
matrix C = (0.432,0.551,0.441,0.400,0.279,0.442,0.475,0.492,0.269,0.094)
		*combine the lower and upper CIs, whreby lower is r1 and upper is r2
matrix D = (B \ C)

		*make the plot
		
set scheme s2color

coefplot matrix(A), ci(D) recast(bar) barwidth(0.5) finten(60) citop ciopt(recast(rcap) lcolor(black)) sort(, descending) xtitle("Pearson correlation coefficients", size(medium)) graphregion(fcolor(white)) ylabel(,labsize(medsmall)) xlabel(, nogrid labsize(small)) legend(off) coeflabels(c1 = "Qualified for office" c2 = "Might run for office" c3 = "Political protests" c4 = "Political meetings" c5 = "Contacted elected official" c6 = "Election volunteer" c7 = "Civil disobedience" c8 = "Political violence" c9 = "Influence government" c10 = "Follow politics") 

restore


							**Finding #3**
*Correlations between "spreads misinformation" (DV) and political loyalties

pwcorr spreads_misinfo demParty repParty trump biden sanders putin qAnon prdBoys whtNats antifa, sig star(.05)

		
**Horizontal bar graph of correlations with feeling thermometers
ci2 spreads_misinfo demParty, corr
ci2 spreads_misinfo repParty, corr
ci2 spreads_misinfo biden, corr
ci2 spreads_misinfo sanders, corr
ci2 spreads_misinfo trump, corr
ci2 spreads_misinfo putin, corr
ci2 spreads_misinfo qAnon, corr
ci2 spreads_misinfo prdBoys, corr
ci2 spreads_misinfo whtNats, corr


preserve

matrix drop _all
		*make a 1-row matrix w/ correlations
matrix A = (0.134,0.130,0.126,0.087,0.142,0.405,0.447,0.418,0.418)
		*make a 1-row matrix w/ lower CIs
matrix B = (0.091,0.086,0.082,0.043,0.098,0.367,0.410,0.380,0.380)
		*make a 1-row matrix w/ upper CIs
matrix C = (0.177,0.173,0.169,0.131,0.185,0.441,0.482,0.454,0.454)
		*combine the lower and upper CIs, whreby lower is r1 and upper is r2
matrix D = (B \ C)
		*make the plot
		
set scheme s1color

coefplot matrix(A), ci(D) recast(bar) barwidth(0.5) finten(60) citop ciopt(recast(rcap) lcolor(black)) sort(, descending) xtitle("Pearson correlation coefficients", size(medium)) graphregion(fcolor(white)) ylabel(,labsize(medsmall)) xlabel(, nogrid labsize(small)) legend(off) recast(bar) barwidth(0.5) coeflabels(c1 = "Democrat Party" c2 = "Republican Party" c3 = "Joe Biden" c4 = "Bernie Sanders" c5 = "Donald Trump" c6 = "Vladimir Putin" c7 = "The QAnon Movement" c8 = "Proud Boys" c9 = "White Nationalists") 

restore


							**Finding #4**
*Linear regression analysis of "spreads misinformation" and psychological traits and political attitudes

regress spreads_misinfo consp_think female age income education demrep7 pid7_str ideo_str left_wing_auth right_wing_auth religiosity need_chaos argue conflict dark_tetrad impulsive subj_num scicom_confidence science_literacy dogmatism paranoia pos_affect neg_affect intol_uncertainty victimhood socmedia_power socmedia_expression, beta


**Create plot of regression coefficients (must standardize first for coefplot. Requires installing pkgs for "center" and "coefplot")

preserve 

center spreads_misinfo consp_think female age income education demrep7 pid7_str ideo_str left_wing_auth right_wing_auth religiosity need_chaos argue conflict dark_tetrad impulsive subj_num scicom_confidence science_literacy dogmatism paranoia pos_affect neg_affect intol_uncertainty victimhood socmedia_power socmedia_expression, inplace standardize

regress spreads_misinfo consp_think female age income education demrep7 pid7_str ideo_str left_wing_auth right_wing_auth religiosity need_chaos argue conflict dark_tetrad impulsive subj_num scicom_confidence science_literacy dogmatism paranoia pos_affect neg_affect intol_uncertainty victimhood socmedia_power socmedia_expression, beta

restore 

set scheme s2color

coefplot, drop(_cons) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) sort(, descending) xtitle("Standardized regression coefficients") graphregion(fcolor(white)) ylabel(,labsize(small)) xlabel(,labsize(small))


							**Finding #5**
*Bivariate correlations between spreads_misinfo and Legacy media (offline and online)

pwcorr spreads_misinfo OFFLINE_network OFFLINE_cable OFFLINE_local OFFLINE_print OFFLINE_radio ONLINE_TVnewssites ONLINE_newspapers ONLINE_newsmags, sig star(.05)


*Bivariate correlations between spreads_misinfo and media sources
*Overall media categories

pwcorr spreads_misinfo legacy_media online_ALTmedia online_SOCIALmedia online_MSmedia, sig star(.05)

**Forest plot**

ci2 spreads_misinfo legacy_media, corr
ci2 spreads_misinfo online_ALTmedia, corr
ci2 spreads_misinfo online_SOCIALmedia, corr
ci2 spreads_misinfo online_MSmedia, corr

  
matrix drop _all
		*make a 1-row matrix w/ correlations
matrix A = (0.172,0.460,0.425,0.195)
		*make a 1-row matrix w/ lower CIs
matrix B = (0.129,0.425,0.388,0.153)
		*make a 1-row matrix w/ upper CIs
matrix C = (0.214,0.494,0.460,0.237)
		*combine the lower and upper CIs, whreby lower is r1 and upper is r2
matrix D = (B \ C)
		*make the plot
		
set scheme s2color

coefplot matrix(A), ci(D) recast(bar) barwidth(0.5) finten(80) citop ciopt(recast(rcap) lcolor(black)) sort(, descending) xtitle("Pearson correlation coefficients", size(medium)) graphregion(fcolor(white)) title("A") ylabel(,labsize(medsmall)) xlabel(0 .1 .2 .3 .4 .5, nogrid labsize(small)) legend(off) coeflabels(c1 = "Legacy Mainstream News Media" c2 = "Alternative Social Media" c3 = "Mainstream Social Media" c4 = "Online Mainstream News Media")



*Individual media sources

pwcorr spreads_misinfo OFFLINE_print OFFLINE_radio ONLINE_newspapers ONLINE_newsmags ONLINE_blogs ONLINE_YouTube ONLINE_Facebook ONLINE_Twitter ONLINE_Reddit ONLINE_Instagram ONLINE_TVnewssites ONLINE_8kun ONLINE_Telegram ONLINE_TruthSocial, sig star(.05)

**Forest plot of bivariate correlations**

ci2 spreads_misinfo OFFLINE_network, corr
ci2 spreads_misinfo OFFLINE_cable, corr
ci2 spreads_misinfo OFFLINE_local, corr
ci2 spreads_misinfo OFFLINE_print, corr
ci2 spreads_misinfo OFFLINE_radio, corr
ci2 spreads_misinfo ONLINE_newspapers, corr
ci2 spreads_misinfo ONLINE_newsmags, corr
ci2 spreads_misinfo ONLINE_blogs, corr
ci2 spreads_misinfo ONLINE_YouTube, corr
ci2 spreads_misinfo ONLINE_Facebook, corr
ci2 spreads_misinfo ONLINE_Twitter, corr
ci2 spreads_misinfo ONLINE_Reddit, corr
ci2 spreads_misinfo ONLINE_Instagram, corr
ci2 spreads_misinfo ONLINE_TVnewssites, corr
ci2 spreads_misinfo ONLINE_8kun, corr
ci2 spreads_misinfo ONLINE_Telegram, corr
ci2 spreads_misinfo ONLINE_TruthSocial, corr


matrix drop _all
		*make a 1-row matrix w/ correlations
matrix A = (0.091,0.107,0.060,0.172,0.202,0.139,0.228,0.323,0.333,0.304,0.326,0.336,0.377,0.117,0.413,0.412,0.412)
		*make a 1-row matrix w/ lower CIs
matrix B = (0.047,0.063,0.016,0.129,0.160,0.096,0.186,0.284,0.294,0.264,0.286,0.296,0.339,0.073,0.376,0.375,0.375)
		*make a 1-row matrix w/ upper CIs
matrix C = (0.134,0.150,0.103,0.214,0.244,0.182,0.270,0.362,0.372,0.343,0.364,0.374,0.414,0.160,0.449,0.448,0.448)
		*combine the lower and upper CIs, whreby lower is r1 and upper is r2
matrix D = (B \ C)
		*make the plot
		
set scheme s2color

coefplot matrix(A), ci(D) sort(, descending) xtitle("Pearson correlation coefficients", size(medium)) graphregion(fcolor(white)) title("B") ylabel(,labsize(small)) xlabel(, nogrid labsize(small)) legend(off) coeflabels(c1 = "Network TV News" c2 = "Cable TV News" c3 = "Local TV News" c4 = "Print newspapers" c5 = "Radio" c6 = "Online newspapers" c7 = "Online news magazines" c8 = "Blogs" c9 = "YouTube" c10 = "Facebook" c11 = "Twitter" c12 = "Reddit" c13 = "Instagram" c14 = "TV News websites" c15 = "8Kun" c16 = "Telegram" c17 = "Truth Social")



					**Appendix figures and tables**

							**Finding #2**

**Heat plot
set scheme tab2
pwcorr spreads_misinfo office_qual office_run polpart_protest polpart_meeting polpart_contacted polpart_volunteer polpart_civdis polpart_violence pol_influence pol_follow, sig star(.05)
matrix C = r(C)
matrix sig = r(sig)
heatplot C, values(label(sig)) lower nodraw generate
gen str sig = cond(_Mlab<.001, "***", cond(_Mlab<.01, "**", cond(_Mlab<.1, "*", "")))
heatplot C, color(SteelBlue FloralWhite DarkGoldenRod) cuts(-1.0(.10)1.0) lower legend(off) aspectratio(1) label xlabel(1 "SM" 2 "DP" 3 "RP" 4 "DT" 5 "JB" 6 "BS" 7 "VP" 8 "QA" 9 "PB" 10 "WN" 11 "AN" ,nogrid labsize(small)) ylabel(, nogrid labsize(medsmall)) xtitle("Pearson correlation coefficients", size(medium)) ///
addplot(scatter _Y _X if _Y!=_X, msym(i) mlab(_Z) mlabf(%9.2f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y==_X, msym(i) mlab(_Z) mlabf(%9.0f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y!=_X, msym(i) mlab(sig) mlabpos(6) mlabgap(2) mlabc(black) mlabsize(vsmall))


							**Finding #3**

**Heat plot
drop _Z _Zid _Y _Yshape _X _Xshape _Mlab sig 
set scheme tab2
pwcorr spreads_misinfo demParty repParty trump biden sanders putin qAnon prdBoys whtNats antifa, sig star(.05)
matrix C = r(C)
matrix sig = r(sig)
heatplot C, values(label(sig)) lower nodraw generate
gen str sig = cond(_Mlab<.001, "***", cond(_Mlab<.01, "**", cond(_Mlab<.1, "*", "")))
heatplot C, color(SteelBlue FloralWhite DarkGoldenRod) cuts(-1.0(.10)1.0) lower legend(off) aspectratio(1) label xlabel(1 "SM" 2 "DP" 3 "RP" 4 "DT" 5 "JB" 6 "BS" 7 "VP" 8 "QA" 9 "PB" 10 "WN" 11 "AN" ,nogrid labsize(small)) ylabel(, nogrid labsize(medsmall)) xtitle("Pearson correlation coefficients", size(medium)) ///
addplot(scatter _Y _X if _Y!=_X, msym(i) mlab(_Z) mlabf(%9.2f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y==_X, msym(i) mlab(_Z) mlabf(%9.0f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y!=_X, msym(i) mlab(sig) mlabpos(6) mlabgap(2) mlabc(black) mlabsize(vsmall))

		
							**Finding #4**

**Regression table (requires "asdoc" package)

asdoc regress spreads_misinfo consp_think female age income education demrep7 pid7_str ideo_str left_wing_auth right_wing_auth religiosity need_chaos argue conflict dark_tetrad impulsive subj_num scicom_confidence science_literacy dogmatism paranoia pos_affect neg_affect intol_uncertainty victimhood socmedia_power socmedia_expression, beta


							**Finding #5**

**Heat plot #1
drop _Z _Zid _Y _Yshape _X _Xshape _Mlab sig 
set scheme tab2
pwcorr spreads_misinfo OFFLINE_network OFFLINE_cable OFFLINE_local OFFLINE_print OFFLINE_radio ONLINE_TVnewssites ONLINE_newspapers ONLINE_newsmags, sig star(.05)
matrix C = r(C)
matrix sig = r(sig)
heatplot C, values(label(sig)) lower nodraw generate
gen str sig = cond(_Mlab<.001, "***", cond(_Mlab<.01, "**", cond(_Mlab<.1, "*", "")))
heatplot C, color(SteelBlue FloralWhite DarkGoldenRod) cuts(-1.0(.10)1.0) lower legend(off) aspectratio(1) label xlabel(1 "SM" 2 "DP" 3 "RP" 4 "DT" 5 "JB" 6 "BS" 7 "VP" 8 "QA" 9 "PB" 10 "WN" 11 "AN" ,nogrid labsize(small)) ylabel(, nogrid labsize(medsmall)) xtitle("Pearson correlation coefficients", size(medium)) ///
addplot(scatter _Y _X if _Y!=_X, msym(i) mlab(_Z) mlabf(%9.2f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y==_X, msym(i) mlab(_Z) mlabf(%9.0f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y!=_X, msym(i) mlab(sig) mlabpos(6) mlabgap(2) mlabc(black) mlabsize(vsmall))
		
		
**Heat plot #2
drop _Z _Zid _Y _Yshape _X _Xshape _Mlab sig 
set scheme tab2
pwcorr spreads_misinfo ONLINE_blogs ONLINE_YouTube ONLINE_Facebook ONLINE_Twitter ONLINE_Reddit ONLINE_Instagram ONLINE_8kun ONLINE_Telegram ONLINE_TruthSocial, sig star(.05)
matrix C = r(C)
matrix sig = r(sig)
heatplot C, values(label(sig)) lower nodraw generate
gen str sig = cond(_Mlab<.001, "***", cond(_Mlab<.01, "**", cond(_Mlab<.1, "*", "")))
heatplot C, color(SteelBlue FloralWhite DarkGoldenRod) cuts(-1.0(.10)1.0) lower legend(off) aspectratio(1) label xlabel(1 "SM" 2 "DP" 3 "RP" 4 "DT" 5 "JB" 6 "BS" 7 "VP" 8 "QA" 9 "PB" 10 "WN" 11 "AN" ,nogrid labsize(small)) ylabel(, nogrid labsize(medsmall)) xtitle("Pearson correlation coefficients", size(medium)) ///
addplot(scatter _Y _X if _Y!=_X, msym(i) mlab(_Z) mlabf(%9.2f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y==_X, msym(i) mlab(_Z) mlabf(%9.0f) mlabpos(0) mlabc(black) ///
        || scatter _Y _X if _Y!=_X, msym(i) mlab(sig) mlabpos(6) mlabgap(2) mlabc(black) mlabsize(vsmall))
